package mylog

import (
	"fmt"
	"github.com/cihub/seelog"
)

type FtpLogger struct{}

func (logger *FtpLogger) Print(sessionId string, message interface{}) {
	seelog.Info(fmt.Sprintf("%s %s", sessionId, message))
}
func (logger *FtpLogger) Printf(sessionId string, format string, v ...interface{}) {
	seelog.Info(fmt.Sprintf("%s %s", sessionId, fmt.Sprintf(format, v...)))
}
func (logger *FtpLogger) PrintCommand(sessionId string, command string, params string) {
	if command == "PASS" {
		seelog.Debug(fmt.Sprintf("%s > PASS ****", sessionId))
	} else {
		seelog.Debug(fmt.Sprintf("%s > %s %s", sessionId, command, params))
	}
}
func (logger *FtpLogger) PrintResponse(sessionId string, code int, message string) {
	seelog.Debug(fmt.Sprintf("%s < %d %s", sessionId, code, message))
}
